package com.lq.service.impl;

import com.lq.mapper.LinkMapper;
import com.lq.pojo.Link;
import com.lq.service.LinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LinkServiceImpl implements LinkService {

    @Autowired
    private LinkMapper linkMapper;

    @Override
    public List<Link> getAllLinks(Integer userId) {
        return linkMapper.getAllLinks(userId);
    }

    @Override
    public boolean saveLink(Link link, Integer userId) {
        return linkMapper.saveLink(link,userId);
    }

    @Override
    public boolean deleteLinkByLinkId(Integer linkId) {
        return linkMapper.deleteLinkByLinkId(linkId);
    }

    @Override
    public int getNumsOfLinkByUserId(Integer userId) {
        return linkMapper.getNumsOfLinkByUserId(userId);
    }
}
